# array creation
# 1) Converting Python sequences to NumPy arrays
import numpy as np
a1D = np.array([1, 2, 3, 4])
a2D = np.array([[1, 2], [3, 4]])
a3D = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
print(a3D)

# 标量类型作为 dtype 关键字的参数
z = np.arange(3, dtype=np.uint8)
print(z)

# 数组类型也可以通过字符代码来引用
f=np.array([1, 2, 3], dtype='f')
print(f)